//
//  RecordField.m
//  Estimation
//
//  Created by Safeneeds-MacBookPro on 2013/07/03.
//  Copyright (c) 2013年 topsign. All rights reserved.
//

#import "RecordField.h"

@implementation RecordField

@synthesize fieldName;
@synthesize value;
@synthesize type;


-(id)init
{
    if(self=[super init])
    {
        //custom
        self.type = STRING;
    }
    return self;
}

-(id)initWithName:(NSString *) name 
{
    if (self=[super init]) {
        //custom
        self.fieldName = name;
        self.type = STRING;
    }
    return self;
}

//- (void) dealloc{
//    [self.fieldName release];
//    [self.value release];
//    [super dealloc];
//}

-(id)initWithName:(NSString *) name type:(enum DataType ) dataType
{
    if (self=[super init]) {
        //custom
        self.fieldName = name;
        self.type = dataType;
    }
    return self;
}

-(NSString *)getSQLValueStr
{
    return [NSString stringWithFormat:@" '%@'",self.value];
}

-(NSString *)getValueStr
{
    return self.value;
}

-(NSData *)getValueData
{
    return self.value;
}
@end
